package com.cdy.jxc_project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdy.jxc_project.domain.TGoodsUnit;
import com.cdy.jxc_project.domain.vo.TGoodsUnitVo;
import com.cdy.jxc_project.mapper.TGoodsUnitMapper;
import com.cdy.jxc_project.service.TGoodsUnitService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Project:jxc_project
 * @Author:cdy(缘生)
 * @Motto:放下杂念,只为迎接明天更好的自己
 * @Date:2023/4/18 11:23
 * */
@Service
@Transactional
public class TGoodsUnitServiceImpl extends ServiceImpl<TGoodsUnitMapper, TGoodsUnit> implements TGoodsUnitService {
    @Resource
    private TGoodsUnitMapper tGoodsUnitMapper;

    @Override
    public List<TGoodsUnit> list() {

        return tGoodsUnitMapper.selectList(null);
    }

    @Override
    public boolean deleteTGoodsUnit(Integer id) {
        tGoodsUnitMapper.deleteById(id);
        return true;
    }

    @Override
    public List<TGoodsUnit> pagingQuery(TGoodsUnitVo tGoodsUnitVo) {
        return tGoodsUnitMapper.pagingQuery(tGoodsUnitVo);
    }

    @Override
    public int querySize(TGoodsUnitVo tGoodsUnitVo) {
        return tGoodsUnitMapper.querySize(tGoodsUnitVo);
    }

    @Override
    public int insertTGoodsUnit(TGoodsUnit tGoodsUnit) {
        return tGoodsUnitMapper.insert(tGoodsUnit);
    }

    @Override
    public int updateTGoodsUnit(TGoodsUnit tGoodsUnit) {
        return tGoodsUnitMapper.updateById(tGoodsUnit);
    }


}
